<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>周末中央公园野餐聚会 - 约会详情</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/cssdist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5; /* 主色调：深靛蓝 */
            --primary-light: #818cf8;
            --primary-dark: #3730a3;
            --secondary: #ec4899; /* 辅助色：粉色 */
            --accent: #f59e0b; /* 强调色：橙色 */
            --success: #10b981; /* 成功色：绿色 */
            --danger: #ef4444; /* 危险色：红色 */
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --bg-light: #f3f4f6;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --radius: 12px;
            --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
            box-shadow: var(--shadow);
        }
        
        .nav-title {
            font-size: 1.15rem;
            font-weight: 600;
            color: var(--primary-dark);
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        /* 图片展示区 */
        .image-gallery {
            position: relative;
            width: 100%;
            background-color: #000;
        }
        
        .gallery-image {
            width: 100%;
            height: 220px;
            object-fit: cover;
        }
        
        .image-count {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
        }
        
        .gallery-indicators {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 5px;
        }
        
        .gallery-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.5);
        }
        
        .gallery-dot.active {
            background-color: white;
        }
        
        /* 活动标题区 */
        .event-header {
            padding: 15px;
            background-color: var(--bg-white);
        }
        
        .event-title {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 10px;
            line-height: 1.3;
        }
        
        .event-tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 10px;
            font-size: 0.75rem;
            font-weight: 500;
            margin-right: 8px;
            margin-bottom: 8px;
        }
        
        .tag-popular {
            background-color: rgba(239, 68, 68, 0.1);
            color: var(--danger);
        }
        
        .tag-outdoor {
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--success);
        }
        
        /* 活动信息区 */
        .event-info {
            padding: 15px;
            background-color: var(--bg-white);
            margin-top: 10px;
            border-radius: var(--radius);
            margin-left: 15px;
            margin-right: 15px;
        }
        
        .info-section {
            margin-bottom: 15px;
        }
        
        .info-title {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .info-content {
            font-size: 1rem;
            line-height: 1.5;
        }
        
        .info-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }
        
        .meta-item i {
            color: var(--primary);
            width: 20px;
            text-align: center;
        }
        
        /* 发起人信息 */
        .host-info {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 15px;
            background-color: var(--bg-white);
            margin-top: 10px;
            border-radius: var(--radius);
            margin-left: 15px;
            margin-right: 15px;
        }
        
        .host-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--primary-light);
        }
        
        .host-details {
            flex: 1;
        }
        
        .host-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 3px;
        }
        
        .host-meta {
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .verify-badge {
            color: var(--primary);
            font-size: 0.8rem;
        }
        
        .follow-btn {
            padding: 6px 15px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        .following-btn {
            padding: 6px 15px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
            background-color: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }
        
        /* 参与者列表 */
        .participants-section {
            padding: 15px;
            background-color: var(--bg-white);
            margin-top: 10px;
            border-radius: var(--radius);
            margin-left: 15px;
            margin-right: 15px;
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .section-title {
            font-size: 1.05rem;
            font-weight: 600;
        }
        
        .view-all {
            font-size: 0.85rem;
            color: var(--primary);
            text-decoration: none;
        }
        
        .participants-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
        }
        
        .participant {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .participant-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 5px;
        }
        
        .participant-name {
            font-size: 0.75rem;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
        }
        
        /* 操作按钮区 */
        .action-buttons {
            display: flex;
            padding: 12px 15px;
            background-color: var(--bg-white);
            margin-top: 10px;
            border-radius: var(--radius);
            margin-left: 15px;
            margin-right: 15px;
            gap: 10px;
        }
        
        .action-btn {
            flex: 1;
            padding: 10px 0;
            border-radius: 8px;
            font-weight: 500;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all 0.2s ease;
        }
        
        .primary-btn {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        .secondary-btn {
            background-color: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }
        
        /* 留言区 */
        .comments-section {
            padding: 15px;
            background-color: var(--bg-white);
            margin-top: 10px;
            border-radius: var(--radius);
            margin-left: 15px;
            margin-right: 15px;
        }
        
        .comment-input-container {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .comment-input {
            flex: 1;
            padding: 10px 12px;
            border-radius: 20px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 0.9rem;
        }
        
        .comment-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .send-comment {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .comments-list {
            margin-top: 15px;
        }
        
        .comment-item {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .comment-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }
        
        .comment-content {
            flex: 1;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
        }
        
        .comment-author {
            font-weight: 500;
            font-size: 0.85rem;
        }
        
        .comment-time {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .comment-text {
            font-size: 0.9rem;
            margin-bottom: 8px;
        }
        
        .comment-actions {
            display: flex;
            gap: 15px;
            font-size: 0.8rem;
        }
        
        .comment-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .comment-action.liked {
            color: var(--danger);
        }
        
        /* 回复区域 */
        .replies {
            margin-left: 46px;
            margin-top: 10px;
        }
        
        .reply-item {
            display: flex;
            gap: 8px;
            margin-bottom: 10px;
        }
        
        .reply-content {
            background-color: var(--bg-light);
            padding: 8px 12px;
            border-radius: 15px;
            flex: 1;
        }
        
        .reply-header {
            display: flex;
            gap: 5px;
            margin-bottom: 3px;
        }
        
        .reply-author {
            font-weight: 500;
            font-size: 0.8rem;
        }
        
        .reply-to {
            color: var(--text-secondary);
            font-size: 0.8rem;
        }
        
        .reply-text {
            font-size: 0.8rem;
        }
        
        .reply-actions {
            display: flex;
            gap: 10px;
            margin-top: 5px;
            font-size: 0.75rem;
        }
        
        .reply-input-container {
            margin-left: 46px;
            margin-top: 10px;
            display: flex;
            gap: 8px;
        }
        
        .reply-input {
            flex: 1;
            padding: 6px 10px;
            border-radius: 15px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 0.8rem;
        }
        
        .send-reply {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.3rem;
            margin-bottom: 3px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast-notification {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast-notification.show {
            opacity: 1;
        }
        
        /* 底部操作栏 */
        .bottom-action-bar {
            position: fixed;
            bottom: 65px;
            left: 0;
            right: 0;
            padding: 12px 15px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            border-top: 1px solid var(--border-light);
            z-index: 999;
        }
        
        .bar-action {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.75rem;
        }
        
        .bar-action i {
            font-size: 1.1rem;
            margin-bottom: 3px;
        }
        
        .bar-action.primary {
            color: var(--primary);
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">约会详情</div>
        <button class="nav-action" id="shareBtn">
            <i class="fas fa-share-alt"></i>
        </button>
    </div>
    
    <!-- 图片展示区 -->
    <div class="image-gallery">
        <img src="https://picsum.photos/id/292/800/400" alt="周末中央公园野餐聚会" class="gallery-image">
        <div class="image-count">1/3</div>
        <div class="gallery-indicators">
            <div class="gallery-dot active"></div>
            <div class="gallery-dot"></div>
            <div class="gallery-dot"></div>
        </div>
    </div>
    
    <!-- 活动标题区 -->
    <div class="event-header">
        <h1 class="event-title">周末中央公园野餐聚会</h1>
        <div>
            <span class="event-tag tag-popular">热门</span>
            <span class="event-tag tag-outdoor">户外活动</span>
        </div>
    </div>
    
    <!-- 活动信息区 -->
    <div class="event-info">
        <div class="info-section">
            <div class="info-title">
                <i class="fas fa-info-circle"></i>
                <span>活动介绍</span>
            </div>
            <div class="info-content">
                周末一起去中央公园野餐吧！带上你最喜欢的美食和饮料，我们可以一起聊天、游戏、享受阳光。现场会有音乐和小游戏，还有惊喜礼品等你来拿！<br><br>
                建议携带：野餐垫、防晒用品、小零食、饮料、好心情<br><br>
                活动免费参加，食物和饮料大家AA制或自带分享。
            </div>
        </div>
        
        <div class="info-section">
            <div class="info-title">
                <i class="fas fa-calendar-alt"></i>
                <span>活动详情</span>
            </div>
            <div class="info-meta">
                <div class="meta-item">
                    <i class="far fa-clock"></i>
                    <span>周六 14:00</span>
                </div>
                <div class="meta-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>中央公园</span>
                </div>
                <div class="meta-item">
                    <i class="fas fa-money-bill-wave"></i>
                    <span>AA制</span>
                </div>
                <div class="meta-item">
                    <i class="fas fa-users"></i>
                    <span>8人已报名</span>
                </div>
            </div>
        </div>
        
        <div class="info-section">
            <div class="info-title">
                <i class="fas fa-map-marker-alt"></i>
                <span>详细地址</span>
            </div>
            <div class="info-content">
                北京市朝阳区中央公园南门入口处草坪（近地铁2号线公园站B出口）
            </div>
        </div>
        
        <div class="info-section">
            <div class="info-title">
                <i class="fas fa-mobile-alt"></i>
                <span>联系信息</span>
            </div>
            <div class="info-content">
                活动组织者：阳光女孩<br>
                联系电话：138****5678（活动前1小时可联系）<br>
                活动群聊：报名后可获取二维码加入
            </div>
        </div>
    </div>
    
    <!-- 发起人信息 -->
    <div class="host-info">
        <img src="https://picsum.photos/id/64/100/100" alt="阳光女孩" class="host-avatar">
        <div class="host-details">
            <div class="host-name">
                阳光女孩 
                <span class="verify-badge"><i class="fas fa-check-circle"></i> 认证用户</span>
            </div>
            <div class="host-meta">
                <i class="fas fa-map-marker-alt"></i>
                <span>距离3.2公里</span>
                <span>·</span>
                <span>组织过12场活动</span>
            </div>
        </div>
        <button class="follow-btn" id="followHostBtn">
            <i class="fas fa-plus"></i> 关注
        </button>
    </div>
    
    <!-- 参与者列表 -->
    <div class="participants-section">
        <div class="section-header">
            <div class="section-title">已报名参与者</div>
            <a href="#" class="view-all">查看全部</a>
        </div>
        <div class="participants-grid">
            <div class="participant">
                <img src="https://picsum.photos/id/64/100/100" alt="阳光女孩" class="participant-avatar">
                <div class="participant-name">阳光女孩（组织者）</div>
            </div>
            <div class="participant">
                <img src="https://picsum.photos/id/91/100/100" alt="电影迷" class="participant-avatar">
                <div class="participant-name">电影迷</div>
            </div>
            <div class="participant">
                <img src="https://picsum.photos/id/26/100/100" alt="书虫" class="participant-avatar">
                <div class="participant-name">书虫</div>
            </div>
            <div class="participant">
                <img src="https://picsum.photos/id/65/100/100" alt="旅行者" class="participant-avatar">
                <div class="participant-name">旅行者</div>
            </div>
            <div class="participant">
                <img src="https://picsum.photos/id/62/100/100" alt="摄影师" class="participant-avatar">
                <div class="participant-name">摄影师</div>
            </div>
        </div>
    </div>
    
    <!-- 操作按钮区 -->
    <div class="action-buttons">
        <button class="action-btn secondary-btn" id="collectBtn">
            <i class="far fa-heart"></i> 收藏
        </button>
        <button class="action-btn secondary-btn" id="messageHostBtn">
            <i class="far fa-comment"></i> 私信组织者
        </button>
        <button class="action-btn primary-btn" id="joinBtn">
            <i class="fas fa-user-plus"></i> 报名参加
        </button>
    </div>
    
    <!-- 留言区 -->
    <div class="comments-section">
        <div class="section-header">
            <div class="section-title">留言讨论 (8)</div>
        </div>
        
        <!-- 留言输入框 -->
        <div class="comment-input-container">
            <img src="https://picsum.photos/id/128/100/100" alt="当前用户" class="user-avatar">
            <input type="text" class="comment-input" placeholder="发表你的想法...">
            <button class="send-comment" id="sendCommentBtn">
                <i class="fas fa-paper-plane"></i>
            </button>
        </div>
        
        <!-- 留言列表 -->
        <div class="comments-list">
            <!-- 留言1 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/91/100/100" alt="电影迷" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">电影迷</div>
                        <div class="comment-time">今天 10:23</div>
                    </div>
                    <div class="comment-text">
                        我会带一些自制的三明治和水果，有人想尝尝吗？
                    </div>
                    <div class="comment-actions">
                        <button class="comment-action like-btn">
                            <i class="far fa-heart"></i> 3
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i> 回复
                        </button>
                    </div>
                    
                    <!-- 回复区域 -->
                    <div class="replies">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="阳光女孩" class="user-avatar">
                            <div class="reply-content">
                                <div class="reply-header">
                                    <span class="reply-author">阳光女孩</span>
                                    <span class="reply-to">回复 电影迷</span>
                                </div>
                                <div class="reply-text">
                                    太棒了！我最喜欢自制三明治了，到时候一定尝尝~
                                </div>
                                <div class="reply-actions">
                                    <button class="comment-action like-btn">
                                        <i class="far fa-heart"></i> 1
                                    </button>
                                    <button class="comment-action reply-btn">
                                        <i class="far fa-comment"></i> 回复
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 回复输入框 (默认隐藏) -->
                    <div class="reply-input-container" style="display: none;">
                        <input type="text" class="reply-input" placeholder="回复 @电影迷...">
                        <button class="send-reply" id="sendReplyBtn">
                            <i class="fas fa-paper-plane"></i>
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- 留言2 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/26/100/100" alt="书虫" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">书虫</div>
                        <div class="comment-time">昨天 18:45</div>
                    </div>
                    <div class="comment-text">
                        请问活动大概会持续到几点呢？我晚上还有点事。
                    </div>
                    <div class="comment-actions">
                        <button class="comment-action like-btn">
                            <i class="far fa-heart"></i> 0
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i> 回复
                        </button>
                    </div>
                    
                    <!-- 回复区域 -->
                    <div class="replies">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="阳光女孩" class="user-avatar">
                            <div class="reply-content">
                                <div class="reply-header">
                                    <span class="reply-author">阳光女孩</span>
                                    <span class="reply-to">回复 书虫</span>
                                </div>
                                <div class="reply-text">
                                    大概到下午5点左右，有事的话可以提前离开哦~
                                </div>
                                <div class="reply-actions">
                                    <button class="comment-action like-btn">
                                        <i class="far fa-heart"></i> 0
                                    </button>
                                    <button class="comment-action reply-btn">
                                        <i class="far fa-comment"></i> 回复
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 留言3 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/65/100/100" alt="旅行者" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">旅行者</div>
                        <div class="comment-time">昨天 15:32</div>
                    </div>
                    <div class="comment-text">
                        我可以带一副桌游过来，大家有想玩的吗？
                    </div>
                    <div class="comment-actions">
                        <button class="comment-action like-btn liked">
                            <i class="fas fa-heart"></i> 5
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i> 回复
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 底部操作栏 -->
    <div class="bottom-action-bar">
        <a href="#" class="bar-action">
            <i class="fas fa-map-marked-alt"></i>
            <span>导航</span>
        </a>
        <a href="#" class="bar-action">
            <i class="fas fa-share-alt"></i>
            <span>分享</span>
        </a>
        <a href="#" class="bar-action primary">
            <i class="fas fa-user-plus"></i>
            <span>报名</span>
        </a>
        <a href="#" class="bar-action">
            <i class="fas fa-flag"></i>
            <span>举报</span>
        </a>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-calendar-alt"></i>
            <span>约会</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-comments"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="far fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 提示消息
        function showToast(message) {
            let toast = document.querySelector('.toast-notification');
            if (toast) {
                toast.remove();
            }
            
            toast = document.createElement('div');
            toast.className = 'toast-notification';
            toast.textContent = message;
            
            document.body.appendChild(toast);
            
            setTimeout(() => {
                toast.classList.add('show');
            }, 10);
            
            setTimeout(() => {
                toast.classList.remove('show');
                setTimeout(() => toast.remove(), 300);
            }, 2500);
        }
        
        // 图片轮播
        const galleryImages = [
            'https://picsum.photos/id/292/800/400',
            'https://picsum.photos/id/431/800/400',
            'https://picsum.photos/id/493/800/400'
        ];
        let currentImageIndex = 0;
        const galleryImgElement = document.querySelector('.gallery-image');
        const imageCountElement = document.querySelector('.image-count');
        const galleryDots = document.querySelectorAll('.gallery-dot');
        
        // 切换图片
        function changeImage(index) {
            currentImageIndex = index;
            galleryImgElement.src = galleryImages[currentImageIndex];
            imageCountElement.textContent = `${currentImageIndex + 1}/${galleryImages.length}`;
            
            // 更新指示器
            galleryDots.forEach((dot, i) => {
                if (i === currentImageIndex) {
                    dot.classList.add('active');
                } else {
                    dot.classList.remove('active');
                }
            });
        }
        
        // 自动轮播
        setInterval(() => {
            let nextIndex = currentImageIndex + 1;
            if (nextIndex >= galleryImages.length) {
                nextIndex = 0;
            }
            changeImage(nextIndex);
        }, 5000);
        
        // 点击指示器切换图片
        galleryDots.forEach((dot, index) => {
            dot.addEventListener('click', () => {
                changeImage(index);
            });
        });
        
        // 返回按钮
        document.getElementById('backBtn').addEventListener('click', () => {
            showToast('返回列表页');
            // 实际应用中这里会跳转到上一页
        });
        
        // 分享按钮
        document.getElementById('shareBtn').addEventListener('click', () => {
            showToast('分享成功');
        });
        
        // 关注组织者
        document.getElementById('followHostBtn').addEventListener('click', function() {
            if (this.textContent.includes('关注')) {
                this.innerHTML = '<i class="fas fa-check"></i> 已关注';
                this.className = 'following-btn';
                showToast('已关注 阳光女孩');
            } else {
                this.innerHTML = '<i class="fas fa-plus"></i> 关注';
                this.className = 'follow-btn';
                showToast('已取消关注');
            }
        });
        
        // 收藏按钮
        document.getElementById('collectBtn').addEventListener('click', function() {
            const icon = this.querySelector('i');
            if (icon.classList.contains('far')) {
                icon.classList.remove('far');
                icon.classList.add('fas');
                this.style.color = 'var(--danger)';
                showToast('已收藏活动');
            } else {
                icon.classList.remove('fas');
                icon.classList.add('far');
                this.style.color = 'var(--text-secondary)';
                showToast('已取消收藏');
            }
        });
        
        // 私信组织者
        document.getElementById('messageHostBtn').addEventListener('click', () => {
            showToast('打开与阳光女孩的聊天窗口');
        });
        
        // 报名参加
        document.getElementById('joinBtn').addEventListener('click', function() {
            if (this.innerHTML.includes('报名参加')) {
                this.innerHTML = '<i class="fas fa-check"></i> 已报名';
                showToast('成功报名活动');
                
                // 更新参与者数量
                const countElements = document.querySelectorAll('.meta-item:last-child span, .participants span');
                countElements.forEach(el => {
                    const currentCount = parseInt(el.textContent.match(/\d+/)[0]);
                    el.textContent = el.textContent.replace(/\d+/, currentCount + 1);
                });
                
            } else {
                this.innerHTML = '<i class="fas fa-user-plus"></i> 报名参加';
                showToast('已取消报名');
                
                // 更新参与者数量
                const countElements = document.querySelectorAll('.meta-item:last-child span, .participants span');
                countElements.forEach(el => {
                    const currentCount = parseInt(el.textContent.match(/\d+/)[0]);
                    el.textContent = el.textContent.replace(/\d+/, currentCount - 1);
                });
            }
        });
        
        // 发送评论
        document.getElementById('sendCommentBtn').addEventListener('click', function() {
            const input = document.querySelector('.comment-input');
            const commentText = input.value.trim();
            
            if (commentText) {
                showToast('评论发布成功');
                input.value = '';
                
                // 实际应用中这里会添加新评论到列表
            } else {
                showToast('请输入评论内容');
            }
        });
        
        // 评论点赞
        document.querySelectorAll('.like-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const icon = this.querySelector('i');
                let countText = this.textContent.trim();
                let count = parseInt(countText.match(/\d+/)?.[0] || 0);
                
                if (icon.classList.contains('far')) {
                    // 点赞
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.classList.add('liked');
                    count += 1;
                } else {
                    // 取消点赞
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.classList.remove('liked');
                    count -= 1;
                }
                
                // 更新点赞数
                this.innerHTML = icon.outerHTML + ' ' + (count > 0 ? count : '');
            });
        });
        
        // 回复功能
        document.querySelectorAll('.reply-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const commentItem = this.closest('.comment-item');
                const replyInputContainer = commentItem.querySelector('.reply-input-container');
                
                if (replyInputContainer) {
                    // 如果已有回复框，切换显示状态
                    replyInputContainer.style.display = replyInputContainer.style.display === 'none' ? 'flex' : 'none';
                } else {
                    // 创建并显示回复框
                    const commentContent = this.closest('.comment-content');
                    const authorName = commentContent.querySelector('.comment-author')?.textContent || 
                                      commentContent.querySelector('.reply-author')?.textContent;
                    
                    const newReplyInput = document.createElement('div');
                    newReplyInput.className = 'reply-input-container';
                    newReplyInput.innerHTML = `
                        <input type="text" class="reply-input" placeholder="回复 @${authorName}...">
                        <button class="send-reply">
                            <i class="fas fa-paper-plane"></i>
                        </button>
                    `;
                    
                    // 添加发送回复事件
                    newReplyInput.querySelector('.send-reply').addEventListener('click', function() {
                        const input = this.parentElement.querySelector('.reply-input');
                        const replyText = input.value.trim();
                        
                        if (replyText) {
                            showToast('回复成功');
                            newReplyInput.remove();
                            
                            // 实际应用中这里会添加新回复到列表
                        } else {
                            showToast('请输入回复内容');
                        }
                    });
                    
                    // 插入到适当位置
                    if (this.closest('.reply-actions')) {
                        this.closest('.reply-item').after(newReplyInput);
                    } else {
                        commentContent.appendChild(newReplyInput);
                    }
                }
            });
        });
        
        // 发送回复
        document.getElementById('sendReplyBtn').addEventListener('click', function() {
            const input = this.parentElement.querySelector('.reply-input');
            const replyText = input.value.trim();
            
            if (replyText) {
                showToast('回复成功');
                this.parentElement.style.display = 'none';
                
                // 实际应用中这里会添加新回复到列表
            } else {
                showToast('请输入回复内容');
            }
        });
        
        // 底部操作栏点击事件
        document.querySelectorAll('.bar-action').forEach(action => {
            action.addEventListener('click', function(e) {
                e.preventDefault();
                const actionName = this.querySelector('span').textContent;
                
                if (actionName === '报名') {
                    const joinBtn = document.getElementById('joinBtn');
                    joinBtn.click(); // 触发报名按钮的点击事件
                } else {
                    showToast(`${actionName}功能已触发`);
                }
            });
        });
    </script>
</body>
</html>

